﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace RCREEE.Library.Entities
{
    public class GeorgeCountry
    {
        #region Private Fields
        // genral fields
        private int _countryId;
        private string _englishName;
        private int _languageCode;
        private string _flagImagePath;

        // english fields
        private string _englishCountryName;
        private float? _englishRenewableEnergyContributionRate;
        private string _englishRenewableEnergyContributionRateComment;
        private float? _englishEnergyEfficiencyContributionRate;
        private string _englishEnergyEfficiencyContributionRateComment;
        private string _englishCapital; //New Attribute according to new comments
        private string _englishArea; //New Attribute according to new comments
        private string _englishCurrency;

        //arabic fields
        private string _arabicCountryName;
        private float? _arabicRenewableEnergyContributionRate;
        private string _arabicRenewableEnergyContributionRateComment;
        private float? _arabicEnergyEfficiencyContributionRate;
        private string _arabicEnergyEfficiencyContributionRateComment;
        private string _arabicCapital; //New Attribute according to new comments
        private string _arabicArea; //New Attribute according to new comments
        private string _arabicCurrency;

        // french fields
        private string _frenchCountryName;
        private float? _frenchRenewableEnergyContributionRate;
        private string _frenchRenewableEnergyContributionRateComment;
        private float? _frenchEnergyEfficiencyContributionRate;
        private string _frenchEnergyEfficiencyContributionRateComment;
        private string _frenchCapital; //New Attribute according to new comments
        private string _frenchArea; //New Attribute according to new comments
        private string _frenchCurrency;

        #endregion

        #region Public Properties

        // General properties
        public int CountryId
        {
            get { return _countryId; }
            set { _countryId = value; }
        }
        public string EnglishName
        {
            get { return _englishName; }
            set { _englishName = value; }
        }
        public int LanguageCode
        {
            get { return _languageCode; }
            set { _languageCode = value; }
        }
        public string FlagImagePath
        {
            get { return _flagImagePath; }
            set { _flagImagePath = value; }
        }

        // English properties
        public string EnglishCountryname
        {
            get { return _englishCountryName; }
            set { _englishCountryName = value; }
        }
        public float? EnglishRenewableEnergyContributionRate
        {
            get { return _englishRenewableEnergyContributionRate; }
            set
            {
                if (value == null)
                    _englishRenewableEnergyContributionRate = -1;
                else
                    _englishRenewableEnergyContributionRate = value;
            }
        }
        public string EnglishRenewableEnergyContributionRateComment
        {
            get { return _englishRenewableEnergyContributionRateComment; }
            set { _englishRenewableEnergyContributionRateComment = value; }
        }
        public float? EnglishEnergyEfficiencyContributionRate
        {
            get { return _englishEnergyEfficiencyContributionRate; }
            set
            {
                if (value == null)
                    _englishEnergyEfficiencyContributionRate = -1;
                else
                    _englishEnergyEfficiencyContributionRate = value;
            }
        }
        public string EnglishEnergyEfficiencyContributionRateComment
        {
            get { return _englishEnergyEfficiencyContributionRateComment; }
            set { _englishEnergyEfficiencyContributionRateComment = value; }
        }
        public string EnglishCurrency
        {
            get { return _englishCurrency; }
            set { _englishCurrency = value; }
        }

        public string EnglishCapital
        {
            get { return _englishCapital; }
            set { _englishCapital = value; }
        }

        public string EnglishArea
        {
            get { return _englishArea; }
            set { _englishArea = value; }
        }

        // Arabic properties
        public string ArabicCountryname
        {
            get { return _arabicCountryName; }
            set { _arabicCountryName = value; }
        }
        public float? ArabicRenewableEnergyContributionRate
        {
            get { return _arabicRenewableEnergyContributionRate; }
            set
            {
                if (value == null)
                    _arabicRenewableEnergyContributionRate = -1;
                else
                    _arabicRenewableEnergyContributionRate = value;
            }
        }
        public string ArabicRenewableEnergyContributionRateComment
        {
            get { return _arabicRenewableEnergyContributionRateComment; }
            set { _arabicRenewableEnergyContributionRateComment = value; }
        }
        public float? ArabicEnergyEfficiencyContributionRate
        {
            get { return _arabicEnergyEfficiencyContributionRate; }
            set
            {
                if (value == null)
                    _arabicEnergyEfficiencyContributionRate = -1;
                else
                    _arabicEnergyEfficiencyContributionRate = value;
            }
        }
        public string ArabicEnergyEfficiencyContributionRateComment
        {
            get { return _arabicEnergyEfficiencyContributionRateComment; }
            set { _arabicEnergyEfficiencyContributionRateComment = value; }
        }
        public string ArabicCurrency
        {
            get { return _arabicCurrency; }
            set { _arabicCurrency = value; }
        }

        public string ArabicCapital
        {
            get { return _arabicCapital; }
            set { _arabicCapital = value; }
        }

        public string ArabicArea
        {
            get { return _arabicArea; }
            set { _arabicArea = value; }
        }

        // French properties
        public string FrenchCountryname
        {
            get { return _frenchCountryName; }
            set { _frenchCountryName = value; }
        }
        public float? FrenchRenewableEnergyContributionRate
        {
            get { return _frenchRenewableEnergyContributionRate; }
            set
            {
                if (value == null)
                    _frenchRenewableEnergyContributionRate = -1;
                else

                    _frenchRenewableEnergyContributionRate = value;
            }
        }
        public string FrenchRenewableEnergyContributionRateComment
        {
            get { return _frenchRenewableEnergyContributionRateComment; }
            set { _frenchRenewableEnergyContributionRateComment = value; }
        }
        public float? FrenchEnergyEfficiencyContributionRate
        {
            get { return _frenchEnergyEfficiencyContributionRate; }
            set
            {
                if (value == null)
                    _frenchEnergyEfficiencyContributionRate = -1;
                else
                    _frenchEnergyEfficiencyContributionRate = value;
            }
        }
        public string FrenchEnergyEfficiencyContributionRateComment
        {
            get { return _frenchEnergyEfficiencyContributionRateComment; }
            set { _frenchEnergyEfficiencyContributionRateComment = value; }
        }
        public string FrenchCurrency
        {
            get { return _frenchCurrency; }
            set { _frenchCurrency = value; }
        }

        public string FrenchCapital
        {
            get { return _frenchCapital; }
            set { _frenchCapital = value; }
        }

        public string FrenchArea
        {
            get { return _frenchArea; }
            set { _frenchArea = value; }
        }

        #endregion

        #region Constructors
        public GeorgeCountry()
        {
        }
        #endregion

        #region Private Methods
        #endregion

        #region Public Methods
        public DataTable GetOneCountryById(int CountryId, int LanguageCode)
        {
            return DataManager.GetOneCountryById(CountryId, LanguageCode);
        }

        public bool UpdateCountry(GeorgeCountry _country)
        {
            return DataManager.UpdateCountry(_country);
        }

        public bool InsertCountry(GeorgeCountry _country)
        {
            return DataManager.InsertCountry(_country);
        }

        [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)]
        public bool DeleteCountry(GeorgeCountry _country)
        {
            return DataManager.DeleteCountry(_country.CountryId);
        }
        #endregion

        #region Overrides
        public override string ToString()
        {
            return EnglishName;
        }
        #endregion
    }
}
